package org.osomit.sacct.builder;

import org.osomit.sacct.entity.ApplicationAccount;

import java.util.Map;

/**
 * @author Jian Fang (John.Jian.Fang@gmail.com)
 *
 * Date: Jun 28, 2009
 * 
 */
public class ApplicationAccountBuilder extends BaseBuilder<ApplicationAccount>{
    
    public ApplicationAccount build(Object object) {
        if(object != null){
            ApplicationAccount acct = new ApplicationAccount();
            Map map = (Map) object;
            acct.setName((String) map.get(ApplicationAccount.NAME));
            acct.setPassword((String) map.get(ApplicationAccount.PASSWORD));

            return acct;
        }

        return null;
    }
}
